<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <title>包围盒计算测试</title>
    <script src="lib/rollup.browser.js"></script>
    <script src="lib/requireES.js"></script>
    <script src="lib/config.js"></script>
</head>
<body>
    <div id="Main"></div>
</body>
    <script type="text/javascript">

    requireES(['zrender/src/zrender', 'zrender/src/core/PathProxy'], function(zrender, PathProxy) {
        var canvas = document.createElement('canvas')
        document.getElementById("Main").appendChild(canvas);
        canvas.width = 1024;
        canvas.height = 600;
        var ctx = canvas.getContext("2d");
        var path = new PathProxy();

        path.beginPath(ctx);
        path.moveTo(20, 20);
        path.bezierCurveTo(100, 0, -100, 100, 100, 100);
        path.quadraticCurveTo(400, 10, 200, 200);

        path.arc(200, 200, 50, 1, 10, true);
        path.stroke(ctx);

        var bb = path.getBoundingRect();
        ctx.beginPath();
        ctx.strokeRect(bb.x, bb.y, bb.width, bb.height);
    });
    </script>
</html>